package com.example.websocket.pattern.structural.filter;

import java.util.ArrayList;
import java.util.List;

public class CriteriaMale implements Criteria {
    @Override
    public List<Person> meetCriteria(List<Person> persons) {
        List<Person> males = new ArrayList<>();
        for (Person p : persons) {
            if (p.getGender().equalsIgnoreCase("Male")){
                males.add(p);
            }
        }
        return males;
    }
}
